//
//  CrossSlipCell.m
//  shise
//
//  Created by 徐国庆 on 14/12/19.
//  Copyright (c) 2014年 MZP. All rights reserved.
//

#import "CrossSlipCell.h"

@implementation CrossSlipCell

- (void)awakeFromNib {
    // Initialization code
}

- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        
        self.activityImageView = [[UIImageView alloc] init];
//        self.activityImageView.backgroundColor = [UIColor redColor];
        [self.contentView addSubview:self.activityImageView];
        
        self.activityNameLabel = [[UILabel alloc] init];
//        self.activityNameLabel.backgroundColor = [UIColor greenColor];
        self.activityNameLabel.textColor = [UIColor blueColor];
        self.activityNameLabel.font = [UIFont systemFontOfSize:15];
        self.activityNameLabel.alpha = 0.8;
        [self.contentView addSubview:self.activityNameLabel];
        
        self.numberOfPhotosAndEndDate = [[UILabel alloc] init];
//        self.numberOfPhotosAndEndDate.backgroundColor = [UIColor yellowColor];
        self.numberOfPhotosAndEndDate.font = [UIFont systemFontOfSize:14];
        self.numberOfPhotosAndEndDate.alpha = 0.5;
        [self.contentView addSubview:self.numberOfPhotosAndEndDate];
        
        self.scrollView = [[UIScrollView alloc] init];
//        self.scrollView.backgroundColor = [UIColor redColor];
        [self.contentView addSubview:self.scrollView];
        self.scrollView.pagingEnabled = NO;
        
        self.crossSlipButton = [UIButton buttonWithType:UIButtonTypeRoundedRect];
        [self.scrollView addSubview:self.crossSlipButton];
        
        
        [_activityImageView release];
        [_activityNameLabel release];
        [_numberOfPhotosAndEndDate release];
        [_scrollView release];
        
    }
    return self;
}

- (void)layoutSubviews
{
    [super layoutSubviews];
    self.activityImageView.frame = CGRectMake(5, 5, 15, 15);
    self.activityNameLabel.frame = CGRectMake(25, 2, 300, 20);
    self.numberOfPhotosAndEndDate.frame = CGRectMake(5, 25, 365, 15);
    self.scrollView.frame = CGRectMake(5, 45, 375 , 155);
    self.scrollView.contentSize = CGSizeMake(155 * 10, 150);
    self.crossSlipButton.frame = CGRectMake(0, 0, 155 * 10, 155);
}

- (void)dealloc
{
    [_activityImageView release];
    [_activityNameLabel release];
    [_numberOfPhotosAndEndDate release];
    [_scrollView release];
    [_crossSlipButton release];
    [super dealloc];
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
